import adapter.*;
import builder.ChildBuilder;
import builder.ManBuilder;
import builder.PersonDirector;
import builder.WomanBuilder;
import builder.base.Child;
import builder.base.Person;
import factory.base.MiPhone;
import factory.base.Phone;
import factory.factoryMethod.AppleFactory;
import factory.factoryMethod.XiaoMiFactory;
import factory.simpleFactory.PhoneFactory;
import factory.base.PhoneType;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.stream.IntStream;

/**
 * @author: whh
 * @Date: 2021/6/7
 * @Description:
 */
public class test {
    public static void main(String[] args) {
        //PhoneFactory factory = new PhoneFactory();
        //Phone phone = factory.makePhone(PhoneType.IPhone);
        //MiPhone miPhone = (MiPhone) factory.makePhone(PhoneType.MiPhone);
        //
        //XiaoMiFactory xiaoMiFactory = new XiaoMiFactory();
        //AppleFactory appleFactory = new AppleFactory();
        //xiaoMiFactory.makePhone();
        //appleFactory.makePhone();

        //PersonDirector pd = new PersonDirector();
        //Person person = pd.constructPerson(new ManBuilder());
        //Person person1 = pd.constructPerson(new WomanBuilder());

        //ChildBuilder childBuilder = new ChildBuilder();
        //Child child = childBuilder.buildChild();
        //System.out.println(child.toString());

        //Target concreteTarget = new ConcreteTarget();
        //concreteTarget.request();
        ////
        ////Adapter adapter = new Adapter();
        ////adapter.request();
        //
        //ObjectAdapter objectAdapter = new ObjectAdapter(new Adaptee());
        //objectAdapter.request();

        YesThreadPool yesThreadPool = new YesThreadPool(new LinkedBlockingDeque<>(10), 2);
        IntStream.rangeClosed(1,10).forEach((i)-> {
            try {
                yesThreadPool.execute(() -> {
                    System.out.println(Thread.currentThread().getName()+"whh的测试");
                });
            }catch (InterruptedException e){
                System.out.println(e);
            }
        });
    }
}
